#{extends 'main.html' /}
#{set title:'Salao Tads' /}
#{stylesheet 'style.css'/}


<head><script> 
		funcionarios= new Array();	
		  	 
       function b(){  
	  aux= new Array();	
         var i = document.f.estado.selectedIndex;  
			aux.push(document.f.estado[i].text);  
			funcionarios.push(document.f.estado[i].value);        
		
						
       }  
	   function mostrar(){
	    
			document.f.campo.value += aux+=",";
		
			
	   }
	   function addfunc()
	   {
	
		   document.f.funcionario.value=funcionarios;

			   }
	  
    </script> 
    
    <script language="JavaScript"> 
function pergunta(){ 
   if (confirm('Deseja Confirmar?')){ 
      document.f.submit() 
   } 
} 
</script> 
</head>
<body>
<div id="Content"> <!--Container -->

	<div id="Header">
     
   		<div id="menuforms">
		
        <ul>
		<br><br>
        <form name="f" action = "cadastroservi">
		<table>
<input type ="hidden" name="funcionario"/>
<th> Cadastro de Servicos</th>
<tr><td>
<select name="estado"  onChange=" b() ; mostrar(); addfunc()">
			<optgroup label="Funcionario">
				<option>Nome Funcionario</option>
				#{list items:lp, as:'p'}
					<option value="${p.id}">${p.nome}</option>
				#{/list}
			</optgroup>
		</select>
</td>
<td>
<textarea name="campo"></textarea>
</td>
</tr>
<tr>

<td>Nome do Servico</td><td><input type="text" name="nome" /></td>
</tr><tr><td>Digite o Valor a Ser Cobrado</td><td><input type="text" name="valor" /></td>
</tr><tr>
<td colspan = "2"><input type="button" onclick="pergunta()"  value ="Salvar"/></td></tr>
</table>

</form>


        </ul>
</div>    
        
  
    <div id="footer">
 <li> 
   <div align="center"><a href="/secure/logout">Encerrar Sessao</a></div>
 </li> 
</div>

</body>
</html>